package com.app.util;

import java.util.Properties;
/**
 * User: Murilo Dourado
 * Date: 12/2/11
 * Time: 7:41 PM
 */
public class PropertiesHelper {
    /**
     * Resposible to return the properties values
     * @param key
     * @return String
     */
    public static String getProperties(String key){
        return getConfiguration("configuration.properties", key);
    }
   /**
     * Resposible to read the properties file
     * @param file
     * @param key
     * @return
     */
    private static String getConfiguration(String file, String key){
        String result = "";
        try{
            Properties p = new Properties();
            p.load(PropertiesHelper.class.getClassLoader().getResourceAsStream(file));
            result = p.getProperty(key);
        }catch (Exception ex){
            ex.printStackTrace();
        }
        return result;
    }
}